package com.study.dynamic.repository;

import com.study.dynamic.dao.mapper.UserMapper;
import com.study.dynamic.pojo.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Optional;

/**
 * @author Mayjean
 * @Date2020/9/9
 */
@Slf4j
@Repository
public class UserRepository {

    @Autowired
    private UserMapper userMapper;

    public Optional<User> getByUserId(String userId){
        return Optional.ofNullable(userMapper.getByUserId(userId));
    }
}